package e_String;

import java.util.Scanner;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package e_String
 * @date 2024/4/1 下午2:49
 */
public class Test05 {
    public static void main(String[] args) {
        String s1 = "admin";
        String s2 = "1213456";
        Scanner scanner = new Scanner(System.in);
            System.out.println("请输入用户名：");
            String s3 = scanner.nextLine();
            System.out.println("请输入密码：");
            String s4 = scanner.nextLine();
            method(s3,s4);

    }

    private static void method(String s3, String s4) {
        for (int i = 0; i < 3; i++){
        if ("admin".equals(s3) && "123456".equals(s4)){
            System.out.println("登录成功");
            break;
        }else  {
            System.out.println("登录失败,重新登录");
        }

        }
    }
}
